<?php
require_once '../ntduc-web1/libraries/utilites/functions.php';

$path = "../ptnhuan-web1/data/films.txt";

$full_path = realpath($path);

$films = mreadFile($path);
?>
<form method="POST">
    <input type="text" name="rate">
    <input type="submit" name="submit" value="Search">
</form>
<?php for ($i = 0; $i < count($films); $i++){
    $film = explode(";", $films[$i]);
    $img = trim($film[0]);
    echo "<img src = '"."../ptnhuan-web1/public/images/films/".$img."'>".$film[1].' '.$film[2]."<br>";
    
}
?>